import java.util.Arrays;
import java.util.Scanner;

public class demo1 {
    //day1
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            long[] a_i = new long[3 * n];

            for (int i = 0; i < 3 * n; i++) {
                a_i[i] = sc.nextLong();
            }

            long sum = 0;
            Arrays.sort(a_i);
            for (int i = 0; i < n; i++) {
                sum += a_i[a_i.length - 2 * (i + 1)];
            }

            System.out.println(sum);
        }
    }
}
